from  rendezvous import *
import sys

if __name__ == "__main__":
    if len(sys.argv)>1:
        print sys.argv[1]
        try:
            c0 = None
            if sys.argv[1]=='1':
                print "Client 1"
                c0 = Client( ('0.0.0.0',32324), ('furyy.is-a-geek.org',30001),'aff')
                c0.connect()
            elif sys.argv[1]=='2':
                c0 = Client(('127.0.0.1',6342),('affenas',30001),'kopi')
                c0.connect()
            else:
                pass
            print "--------------"
            print c0.get_peer_list()
            while True:
                time.sleep(1)
        except KeyboardInterrupt:
            if c0:
                c0.disconnect()

